package com.alstudio.view;

import java.util.ArrayList;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.alstudio.ui.base.BaseActivity;

public class ViewUtils {

	public static void showView(View v) {
		if (v != null) {
			v.setVisibility(View.VISIBLE);
		}
	}

	public static void goneView(View v) {
		if (v != null) {
			v.setVisibility(View.GONE);
		}
	}

	public static void invisibleView(View v) {
		if (v != null) {
			v.setVisibility(View.INVISIBLE);
		}
	}

	public static void setBackgroundRes(View view, int bgId) {
		if (view != null) {
			view.setBackgroundResource(bgId);
		}
	}
	
	public static void setImageSrc(ImageView v, int src) {
		if (v != null) {
			v.setImageResource(src);
		}
	}

	public static void showText(TextView view, String text) {
		try {
			view.setText(text);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public static void showText(TextView view, int str) {
		try {
			view.setText(str);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
